package dao.filesystem;

import dao.ApplicationSettingsDAO;
import domain.ApplicationSettings;

public class SettingsFileDAO extends AbstractFileDAO<ApplicationSettings> implements ApplicationSettingsDAO {

    public String getFileName() {
        return "ApplicationSettings.data";
    }

    public SettingsFileDAO() throws Exception {
        super();
    }


    public void createApplicationSettings() throws Exception {
        this.save(new ApplicationSettings());

    }

    public ApplicationSettings getApplicationSettings() throws Exception {
        return this.findAll().iterator().next();
    }

    public void updateApplicationSettings(ApplicationSettings settings) throws Exception {
        this.save(settings);

    }
}